window.onload = function(){
	//如果已经管理员登录，直接跳转到管理员页面
	var adminMsg = sessionStorage.getItem('adminMsg');
	if(adminMsg!=undefined){
		window.location.href="adminIndex.jsp";
	}
}
function $(id){
	return document.getElementById(id);
}
function check() {
    var adminname = $("username").value;
    var password = $("password").value;
    if(adminname.length ===0){
        $("msg").innerHTML = "账号不能为空！";
        $("username").focus();
        return false;
    }
    if(adminname.length>12){
     	$("msg").innerHTML = "账号不能超过12个字符！";
     	$("username").focus();
     	return false;
    }
	if(password.length ===0){
        $("msg").innerHTML = "密码不能为空！";
        $("password").focus();
        return false;
     }
     if(password.length>12){
        $("msg").innerHTML = "密码不能超过12个字符！";
        $("password").focus();
        return false;
     }
        //console.log("登录成功！");
     var json = {
    		 instruct:"adminlogin",
    		 uname:adminname,
    		 password:password
     }
     goAjax(json);
     return true;
     }
